<template>
  <!-- 页面内容容器 -->
  <div class="page-container">
    <!-- 底部导航栏 -->
    <a-tabs v-model:activeKey="activeKey" centered size="large">
      <a-tab-pane key="1">
        <template #tab>
          <div class="vertical-tab" @click="handleToHome">
            <HomeOutlined :style="{ fontSize: '28px' }" />
            <span>首页</span>
          </div>
        </template>
      </a-tab-pane>
      <a-tab-pane key="2">
        <template #tab>
          <div class="vertical-tab" @click="handleToAdminList">
            <FormOutlined :style="{ fontSize: '28px' }" />
            <span>行测技巧</span>
          </div>
        </template>
      </a-tab-pane>
      <a-tab-pane key="3">
        <template #tab>
          <div class="vertical-tab" @click="handleToExplainlist">
            <PictureOutlined :style="{ fontSize: '28px' }" />
            <span>申论技巧</span>
          </div>
        </template>
      </a-tab-pane>
      <a-tab-pane key="4">
        <template #tab>
          <div class="vertical-tab" @click="handleToAbout">
            <UserSwitchOutlined :style="{ fontSize: '28px' }" />
            <span>我的</span>
          </div>
        </template>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script lang="ts" setup>
import {
  HomeOutlined,
  FormOutlined,
  PictureOutlined,
  UserSwitchOutlined,
} from '@ant-design/icons-vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const activeKey = ref('1')
const router = useRouter()

function handleToHome() {
  router.push({
    path: '/home',
  })
}

function handleToAdminList() {
  console.log('点击了行测技巧页面')
  router.push({
    path: '/adminskilllist',
  })
}

function handleToExplainlist() {
  console.log('点击了行测技巧页面')
  router.push({
    path: '/explain',
  })
}

function handleToAbout() {
  console.log('点击了行测技巧页面')
  router.push({
    path: '/about',
  })
}
</script>

<style scoped>
/* 新增：页面容器 */
.page-container {
  position: relative;
  min-height: 10vh;
  display: flex;
  flex-direction: column;
}

/* 新增：内容区域 */

/* 示例内容样式 */

/* 底部导航栏样式 */
.vertical-tab {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  gap: 4px; /* 控制图标和文字的间距 */
}

/* 移除所有 Tab 的下划线 */
:deep(.ant-tabs-ink-bar) {
  display: none !important;
}

/* 可选：移除激活态底部边框 */
:deep(.ant-tabs-tab-active) {
  border-bottom: none !important;
}

.ant-tabs {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 160px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  background: #f5f5f5;
  z-index: 100; /* 确保导航栏在顶部 */
}
</style>
